package recycle.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import recycle.pojo.Maintenance;
import recycle.service.AdminService;
import recycle.service.MaintenanceService;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/MaintenanceController")
public class MaintenanceController {
    @Resource
    private MaintenanceService maintenanceService;
    @RequestMapping("/findById.json")
    public Maintenance findById(Maintenance orderId) {
        return maintenanceService.findById(orderId);
    }

    @RequestMapping("/findAll.json")
    public List<Maintenance> findAll() {
        return maintenanceService.findAll();
    }

    @RequestMapping("/save.do")
    public int save(Maintenance maintenance) {
        return maintenanceService.save(maintenance);
    }

    @RequestMapping("/delete.do")
    public int delete(Maintenance orderId) {
        return maintenanceService.delete(orderId);
    }

    @RequestMapping("/update.do")
    public int update(Maintenance maintenance) {
        return maintenanceService.update(maintenance);
    }

}
